home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue26 / tiptrix / LISTING4.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-09-17  |  687 b   |  20 lines

  1. var
  2.   h: HRSRC;
  3.   ptrBlock, verinfo: Pointer;
  4.   verInfoSize: integer;
  5. begin
  6.   // ...
  7.   h := FindResource(HInstance, '#1', RT_VERSION);
  8.   if h <> 0 then begin
  9.     ptrBlock := LockResource(LoadResource(HInstance, h));
  10.     VerQueryValue(ptrBlock, '\', verInfo, verInfoSize);
  11.     with PVSFixedFileInfo(verInfo)^ do
  12.       Version.Caption := ' Version ' +
  13.         IntToStr(dwProductVersionMS div 65536) + '.' +     // major version
  14.         IntToStr(dwProductVersionMS mod 65536) + '.' +     // minor version
  15.         IntToStr(dwProductVersionLS div 65536) + '.' +     // release
  16.         IntToStr(dwProductVersionLS mod 65536);            // build number
  17.   end;
  18.   // ...
  19. end;
  20.